fix(sdk-coin-sol): allow WithdrawSol stake pool instruction - #9741
Merged
mullapudipruthvik merged 1 commit intoSep 16, 2026
Conversation
JPool (JSOL) unstaking transactions sent via WalletConnect customTx intents failed with NotSupported because the SPL Stake Pool program's WithdrawSol instruction (discriminator 16) was missing from the SDK instruction allowlist. Add it to ValidInstructionTypesEnum and VALID_SYSTEM_INSTRUCTION_TYPES so these transactions validate and classify as CustomTx like other DeFi protocol instructions. Ticket: DEFI-887
Contributor
mullapudipruthvik
marked this pull request as ready for review
September 15, 2026 15:59
Contributor
|
|
mukeshsp
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the SPL Stake Pool program's
WithdrawSolinstruction (discriminator 16) to the Solana SDK instruction allowlist (ValidInstructionTypesEnum+VALID_SYSTEM_INSTRUCTION_TYPES).Problem
JPool (JSOL) unstaking transactions sent via Narval/WalletConnect as
customTxintents fail in production with:Both Jito and JPool run on the same SPL Stake Pool program, but Jito unstake uses
WithdrawStake(discriminator 10, already allowlisted) while JPool "Unstake with Delay" usesWithdrawSol(discriminator 16, burns pool tokens, withdraws SOL from the pool reserve).validateIntructionTypesruns insidegetTransactionTypeduringTransaction.fromRawTransaction, so these txs failed before they could even be classified asCustomTx.JPool deposits work (
DepositSolis allowlisted) — only the unstake leg fails.Change
modules/sdk-coin-sol/src/lib/constants.ts: addWithdrawSoltoValidInstructionTypesEnumandVALID_SYSTEM_INSTRUCTION_TYPESWalletConnectDefiCustomTxmemo classifies the tx asTransactionType.CustomTx, which wallet-platform already handles for every other DeFi protocol — no WP code change neededTests
getInstructionTypereturns'WithdrawSol'for a stake-pool WithdrawSol instruction (built viaStakePoolInstruction.withdrawSolfrom@solana/spl-stake-pool)validateIntructionTypesaccepts a realistic JPool unstake set (SetComputeUnitLimit + SetPriorityFee + Approve + WithdrawSol + memo)getTransactionTypeclassifies that set asTransactionType.CustomTx(numeric enum 31)Safety
The allowlist is a classification gate, not the security boundary: customTx keeps
hasUnvalidatedData=true(2nd-admin approval), Narval's review flow, and on-chain program constraints (WithdrawSolburns pool tokens owned by the signer; cannot move funds the wallet doesn't own). Same risk class as the already-allowlistedDepositSol/WithdrawStake/MintTo.Rollout
Cut a new
@bitgo-beta/sdk-coin-solrelease → bump inbitgo-microservices(WP pins7.6.4-beta.618) → deploy WP.Ticket: DEFI-887
🤖 This PR was generated with pi